package variable;

import java.util.Scanner;

public class Retirement2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("how much do you need for retire?");
        double goal = in.nextDouble();
        System.out.println("Interest rate in %:");
        double rate = in.nextDouble();
        double balance = 0;
        int year = 0;

        String input;
        do{
            System.out.println("how much will you contribute this year");
            double payment = in.nextDouble();
            balance = balance*(1+rate)+payment;
            System.out.println("your balance is "+balance+",do you want to retire?");
            input = in.next();
        }while (input.equals("N"));
    }
}
